package com.wuhenzhizao.sku.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by wuhenzhizao on 2017/7/20.
 */
public class SkuAttribute implements Parcelable {
    private String key; //颜色，尺碼
    private String value; //颜色值，xl
    private String valueDesc; //红色,尺碼
    private String skuImage; //规格对应的图片
    private String colorImg; //当前颜色对应的商品图片

    public SkuAttribute() {
    }

    public SkuAttribute(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public SkuAttribute(String key, String value, String valueDesc, String skuImage, String colorImg) {
        this.key = key;
        this.value = value;
        this.valueDesc = valueDesc;
        this.skuImage = skuImage;
        this.colorImg = colorImg;
    }

    public String getValueDesc() {
        return valueDesc == null ? "" : valueDesc;
    }

    public void setValueDesc(String valueDesc) {
        this.valueDesc = valueDesc;
    }

    public String getSkuImage() {
        return skuImage == null ? "" : skuImage;
    }

    public void setSkuImage(String skuImage) {
        this.skuImage = skuImage;
    }

    public String getKey() {
        return key;
    }

    public String getColorImg() {
        return colorImg == null ? "" : colorImg;
    }

    public void setColorImg(String colorImg) {
        this.colorImg = colorImg;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return "SkuAttribute{" +
                "key='" + key + '\'' +
                ", value='" + value + '\'' +
                ", img='" + colorImg + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.key);
        dest.writeString(this.value);
        dest.writeString(this.colorImg);
        dest.writeString(this.skuImage);
        dest.writeString(this.skuImage);
    }

    protected SkuAttribute(Parcel in) {
        this.key = in.readString();
        this.value = in.readString();
        this.colorImg = in.readString();
        this.valueDesc = in.readString();
        this.skuImage = in.readString();
    }

    public static final Creator<SkuAttribute> CREATOR = new Creator<SkuAttribute>() {
        @Override
        public SkuAttribute createFromParcel(Parcel source) {
            return new SkuAttribute(source);
        }

        @Override
        public SkuAttribute[] newArray(int size) {
            return new SkuAttribute[size];
        }
    };
}
